package com.wjs.blog.controller;

import com.wjs.blog.service.CommentService;
import com.wjs.blog.vo.Result;
import com.wjs.blog.vo.parms.CommentParms;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/comments")
public class CommentsControl {
    @Autowired
    CommentService commentservice;
    @GetMapping("/article/{id}")
    public Result comments(@PathVariable("id") long id){
        return commentservice.commentsByArticleId(id);
    }
    @PostMapping("/create/change")
    public Result comment(@RequestBody CommentParms commentParam){
        return commentservice.comment(commentParam);
    }
}
